fix(model): anthorpic stream thinking event#1943
Merged
chickenlj merged 1 commit intoJul 6, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes missing support for Anthropic streaming thinking_delta events by parsing them into AgentScope ThinkingBlock content blocks, bringing streaming behavior in line with the already-supported non-streaming thinking blocks.
Changes:
- Added handling for
delta().thinking()inAnthropicResponseParser.parseStreamEvent(...)to emitThinkingBlockchunks. - Added a regression unit test that builds a
RawContentBlockDeltaEventwiththinkingDelta(...)and verifies parsing behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-anthropic/src/main/java/io/agentscope/extensions/model/anthropic/formatter/AnthropicResponseParser.java | Adds streamed thinking delta parsing into ThinkingBlock during content-block delta events. |
| agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-anthropic/src/test/java/io/agentscope/extensions/model/anthropic/formatter/AnthropicResponseParserTest.java | Adds regression coverage ensuring thinkingDelta stream events produce a ThinkingBlock with expected content. |
zouyx
pushed a commit
to zouyx/agentscope-java
that referenced
this pull request
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1636 by parsing Anthropic streaming thinking_delta events into AgentScope ThinkingBlock content blocks. Non-streaming thinking blocks were already supported; this adds
parity for streamed responses.
Changes